var testData = Array.from({length: 5000}, () => Math.round(Math.random() * 10) )

var res = []
for (let i of testData) {
    if (!res.includes(i)) {
        res.push(i)
    }
}

console.log(res)